extends Area3D

func _on_body_entered(body):
	if body.get_class() == "VehicleBody3D":
		var max_health = body.get_parent().max_health
		body.health = max_health
		body.get_parent().update_health_bar(max_health, max_health)
		get_parent().queue_free()
	elif body.get_class() == "StaticBody3D":
		var max_health = body.get_parent().max_health
		body.get_parent().health = max_health
		body.get_parent().get_parent().update_health_bar(max_health, max_health)
		get_parent().queue_free()
